// Copyright © 2025 Alibaba Cloud. All rights reserved.
//
// Author: keria
// Date: 2025/2/13
// Brief: 播放器自定义顶部横栏组件

import 'package:aliplayer_widget/ui/aliplayer_shared_animation_widget.dart';
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

/// 自定义顶部横栏组件
class AliPlayerCenterWidget extends AliPlayerSharedAnimationWidget {
  /// 设置按钮点击回调
  final VoidCallback? onPressed;

  /// 构造函数
  const AliPlayerCenterWidget({
    super.key,
    required super.animationManager,
    this.onPressed,
  });

  @override
  Widget buildContent(BuildContext context) {
    return Center(
      child: IconButton(
        icon: Icon(
          Icons.play_circle_rounded,
          // ignore: deprecated_member_use
          color: Colors.white54.withOpacity(0.5),
          size: 100.w,
        ),
        onPressed: onPressed,
      ),
    );
  }
}
